import axios from '@/common/request.js';

//获取用户的收货地址接口
export const addressList = payload => axios({
	url: `/address/list`,
	method: 'post',
	payload
})

//获取收货地址的详情
export const addressDetail = payload => axios({
	url: `/address/detail`,
	method: 'post',
	payload
})

//添加或更新收货地址
export const addressSave = payload => axios({
	url: `/address/save`,
	method: 'post',
	payload
})

//删除指定的收货地址
export const addreDelete = payload => axios({
	url: `/address/delete`,
	method: 'post',
	payload
})

//获取省份
export const getAllProvince = payload => axios({
	url: `/area/getAllProvince`,
	method: 'get'
})

//获取省份下的城市
export const getAllCity = id => axios({
	url: `/area/getAllCity/${id}`,
	method: 'get'
})

//获取省份下的城市
export const getAllArea = id => axios({
	url: `/area/getAllArea/${id}`,
	method: 'get'
})

//通过省市区获取小区列表
export const communityList = payload => axios({
	url: `/community/list`,
	method: 'post',
	payload
})